<template>
  <el-select v-model="selected" style="width:120px;" class="filter-item">
    <el-option
      v-for="item in options"
      :key="item.value"
      :label="item.text"
      :value="item.value"
    />
  </el-select>
</template>

<script>
export default {
  name: 'Select',
  props: {
    value: {
      type: Number
    },
    eventType: {
      type: String
    },
    options: {
      type: Array,
      default() {
        return []
      }
    }
  },
  computed: {
    selected: {
      get() {
        return this.value
      },
      set(val) {
        if (this.eventType) {
          this.$emit(this.eventType, val)
        }
      }
    }
  }
}
</script>

